Results 1 to 10 of 12

Thread: Shell Scripting

Hybrid View

  1. #1
    Join Date
    Sep 2011
    Beans
    14

    Exclamation Shell Scripting

    how to replace Alt+Enter from within text file .

    sample input book2.txt is below..

    1212||sdfsdfsdf fgkdjfkgljlsdfg||sdfsdf
    4454||"sadfsdfg
    sdfgsdfg
    sdf"||sdfgdfg
    4454||ds gkdkjfhgskjfsdhkjg||sdfsdf

    in above data, each line start with number. and is "||" delimited, but the 3rd record is broken into 3 lines due to alt+enter.

    sed cntrl+J not helped

    Regards
    Rohit
    Last edited by rohit verma; October 8th, 2012 at 04:14 PM.

  2. #2
    Join Date
    Feb 2008
    Location
    Pelican Bay Correctional
    Beans
    Hidden!

    Re: Shell Scripting

    replace it with what?
    Do you realize how hard it is for me to explain to people that I know you?

  3. #3
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    6,020
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: Shell Scripting

    Sorry, I don't understand. What are you trying to replace, and what are you trying to put there instead?

  4. #4
    Join Date
    Sep 2011
    Beans
    14

    Re: Shell Scripting

    Thanks buddies for response..

    i need to replace Alt+enter with any character...
    Blank space / abc any thing


    regards
    Rohit

  5. #5
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    6,020
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: Shell Scripting

    I don't know what you mean by Alt-Enter. Can you provide before and after examples? Printouts of commands like:
    hd before-file
    hd after-file
    would be great.

    Are you trying to merge all the lines together as one long line?

  6. #6
    Join Date
    Sep 2011
    Beans
    14

    Re: Shell Scripting

    hi the cog,

    sample input u can build by following below steps.
    1>open ms excel (on windows ).
    2>fill 2 to 3 cells in 2 or more row.
    3>while editing any cell , hit Alt + Enter and u will see new line in same cell, write few more text in new line.
    4>save file as tab delimited .txt file .
    5> open the same in any text editor..
    6> you will find line on which you used (alt + enter) is broken..


    hope i am not confusing you all.. Sorry if so.

  7. #7
    Join Date
    Sep 2011
    Beans
    14

    Re: Shell Scripting

    Input ::
    1212||sdfsdfsdf fgkdjfkgljlsdfg||sdfsdf
    4454||"sadfsdfg
    sdfgsdfg
    sdf"||sdfgdfg
    4454||ds gkdkjfhgskjfsdhkjg||sdfsdf


    Output:::
    1212||sdfsdfsdf fgkdjfkgljlsdfg||sdfsdf
    4454||"sadfsdfg sdfgsdfg sdf"||sdfgdfg
    4454||ds gkdkjfhgskjfsdhkjg||sdfsdf

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •