Computing.Net > Forums > Unix > File modification

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

File modification

Reply to Message Icon

Name: johan
Date: July 31, 2007 at 04:55:54 Pacific
OS: sun 9
CPU/Ram: 1
Product: 1
Comment:

I have large file as below:

| p 342434 24234324 234234 | p werwerwer 8ew8we9r8 | p asdasdasdadads e.t.c. many times

It should look like next one:

| p 342434 24234324 234234
| p werwerwer 8ew8we9r8
| p asdasdasdadads
| p e.t.c. (always ^| p)
What I can do?

Thanks for You helps.




Sponsored Link
Ads by Google

Response Number 1
Name: natf
Date: July 31, 2007 at 07:37:43 Pacific
Reply:

try this

tr '|' '\n' < inputfile > outputfile1
sed 's/^/|/' outputfile1 > outputfile2

There could be a one liner to do it, but this will do the job.


0

Response Number 2
Name: johan
Date: July 31, 2007 at 23:09:38 Pacific
Reply:

Many thanks natf

Your help was great for my.

Johan


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: File modification

script to get the files created on recent sat www.computing.net/answers/unix/script-to-get-the-files-created-on-recent-sat/8422.html

Scan folder… www.computing.net/answers/unix/scan-folder/5277.html

Unix Shell Script Files www.computing.net/answers/unix/unix-shell-script-files/6215.html