ShareLaTeX - Text formatted as table conversion into LaTeX table











up vote
1
down vote

favorite












I want to convert a plain text formatted as a table into a LaTeX table. I have a routing table I wanted to include in my file but here it is:



Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/0


I tried manually to create a table but I have to include many like this and it would take too long, I also tried consider it as code using begin{listing}... end{listing} but doesn't format well either.



I was wondering if is there was any tool or suggested command.



PS:
Also the last line "0/0/0" should be part of the previous one.










share|improve this question
























  • May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
    – Raaja
    Aug 6 at 6:58












  • there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
    – David Carlisle
    Aug 6 at 8:14

















up vote
1
down vote

favorite












I want to convert a plain text formatted as a table into a LaTeX table. I have a routing table I wanted to include in my file but here it is:



Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/0


I tried manually to create a table but I have to include many like this and it would take too long, I also tried consider it as code using begin{listing}... end{listing} but doesn't format well either.



I was wondering if is there was any tool or suggested command.



PS:
Also the last line "0/0/0" should be part of the previous one.










share|improve this question
























  • May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
    – Raaja
    Aug 6 at 6:58












  • there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
    – David Carlisle
    Aug 6 at 8:14















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to convert a plain text formatted as a table into a LaTeX table. I have a routing table I wanted to include in my file but here it is:



Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/0


I tried manually to create a table but I have to include many like this and it would take too long, I also tried consider it as code using begin{listing}... end{listing} but doesn't format well either.



I was wondering if is there was any tool or suggested command.



PS:
Also the last line "0/0/0" should be part of the previous one.










share|improve this question















I want to convert a plain text formatted as a table into a LaTeX table. I have a routing table I wanted to include in my file but here it is:



Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet
0/0/0


I tried manually to create a table but I have to include many like this and it would take too long, I also tried consider it as code using begin{listing}... end{listing} but doesn't format well either.



I was wondering if is there was any tool or suggested command.



PS:
Also the last line "0/0/0" should be part of the previous one.







tables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 6 at 7:28









CarLaTeX

28.6k446122




28.6k446122










asked Aug 6 at 6:54









Lorenzo Rossi

61




61












  • May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
    – Raaja
    Aug 6 at 6:58












  • there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
    – David Carlisle
    Aug 6 at 8:14




















  • May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
    – Raaja
    Aug 6 at 6:58












  • there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
    – David Carlisle
    Aug 6 at 8:14


















May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
– Raaja
Aug 6 at 6:58






May be this might help you tex.stackexchange.com/questions/165918/… ? I think you could pull the same work-around mentioned there
– Raaja
Aug 6 at 6:58














there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
– David Carlisle
Aug 6 at 8:14






there are tools but really with a any text editor it should only be a few seconds work to change each run of white space to &, add a \ at the end of the lines and then add some begin{tabular} markup that gives the possibility for hand tuning the layout and will give better, more understandable markup and output than an automated generation.
– David Carlisle
Aug 6 at 8:14












1 Answer
1






active

oldest

votes

















up vote
1
down vote













If your aim is to include the output of some program and not to adapt the information, you can include it verbatim, either by copying it to the LaTeX file or by keeping it in a separate file that is included verbatim. Depending on the text width you may have to adapt the font size.



documentclass{article}
usepackage{verbatim}
begin{document}

noindent
{footnotesize
begin{verbatim}
Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0
end{verbatim}
}

% Alternatively, load the data from a file.

noindent
{footnotesize
verbatiminput{routing.txt}
}

end{document}


enter image description here



The file routing.txt contains the following lines:



Routing Tables: Public
Destinations : 10 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f444791%2fsharelatex-text-formatted-as-table-conversion-into-latex-table%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    If your aim is to include the output of some program and not to adapt the information, you can include it verbatim, either by copying it to the LaTeX file or by keeping it in a separate file that is included verbatim. Depending on the text width you may have to adapt the font size.



    documentclass{article}
    usepackage{verbatim}
    begin{document}

    noindent
    {footnotesize
    begin{verbatim}
    Routing Tables: Public
    Destinations : 10 Routes : 10

    Destination/Mask Proto Pre Cost Flags NextHop Interface

    10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
    10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0
    end{verbatim}
    }

    % Alternatively, load the data from a file.

    noindent
    {footnotesize
    verbatiminput{routing.txt}
    }

    end{document}


    enter image description here



    The file routing.txt contains the following lines:



    Routing Tables: Public
    Destinations : 10 Routes : 10

    Destination/Mask Proto Pre Cost Flags NextHop Interface

    10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
    10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0





    share|improve this answer

























      up vote
      1
      down vote













      If your aim is to include the output of some program and not to adapt the information, you can include it verbatim, either by copying it to the LaTeX file or by keeping it in a separate file that is included verbatim. Depending on the text width you may have to adapt the font size.



      documentclass{article}
      usepackage{verbatim}
      begin{document}

      noindent
      {footnotesize
      begin{verbatim}
      Routing Tables: Public
      Destinations : 10 Routes : 10

      Destination/Mask Proto Pre Cost Flags NextHop Interface

      10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
      10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
      10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
      10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0
      end{verbatim}
      }

      % Alternatively, load the data from a file.

      noindent
      {footnotesize
      verbatiminput{routing.txt}
      }

      end{document}


      enter image description here



      The file routing.txt contains the following lines:



      Routing Tables: Public
      Destinations : 10 Routes : 10

      Destination/Mask Proto Pre Cost Flags NextHop Interface

      10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
      10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
      10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
      10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0





      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        If your aim is to include the output of some program and not to adapt the information, you can include it verbatim, either by copying it to the LaTeX file or by keeping it in a separate file that is included verbatim. Depending on the text width you may have to adapt the font size.



        documentclass{article}
        usepackage{verbatim}
        begin{document}

        noindent
        {footnotesize
        begin{verbatim}
        Routing Tables: Public
        Destinations : 10 Routes : 10

        Destination/Mask Proto Pre Cost Flags NextHop Interface

        10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
        10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0
        end{verbatim}
        }

        % Alternatively, load the data from a file.

        noindent
        {footnotesize
        verbatiminput{routing.txt}
        }

        end{document}


        enter image description here



        The file routing.txt contains the following lines:



        Routing Tables: Public
        Destinations : 10 Routes : 10

        Destination/Mask Proto Pre Cost Flags NextHop Interface

        10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
        10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0





        share|improve this answer












        If your aim is to include the output of some program and not to adapt the information, you can include it verbatim, either by copying it to the LaTeX file or by keeping it in a separate file that is included verbatim. Depending on the text width you may have to adapt the font size.



        documentclass{article}
        usepackage{verbatim}
        begin{document}

        noindent
        {footnotesize
        begin{verbatim}
        Routing Tables: Public
        Destinations : 10 Routes : 10

        Destination/Mask Proto Pre Cost Flags NextHop Interface

        10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
        10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0
        end{verbatim}
        }

        % Alternatively, load the data from a file.

        noindent
        {footnotesize
        verbatiminput{routing.txt}
        }

        end{document}


        enter image description here



        The file routing.txt contains the following lines:



        Routing Tables: Public
        Destinations : 10 Routes : 10

        Destination/Mask Proto Pre Cost Flags NextHop Interface

        10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
        10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
        10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/0






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 6 at 13:40









        gernot

        26.5k22960




        26.5k22960






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f444791%2fsharelatex-text-formatted-as-table-conversion-into-latex-table%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?