![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| make multiple line containing a pattern into single line | VTAWKVT | Shell Programming and Scripting | 10 | 4 Weeks Ago 06:54 AM |
| replacing multiple lines with single line | siba.s.nayak | Shell Programming and Scripting | 3 | 05-27-2008 11:43 PM |
| Splitting the line in multiple lines | dd_sh | Shell Programming and Scripting | 3 | 03-31-2008 10:54 AM |
| Reading multiple lines as single | braindrain | Shell Programming and Scripting | 9 | 10-18-2006 07:16 AM |
| Need output in different lines not in one single line | csaha | Shell Programming and Scripting | 1 | 02-08-2006 04:28 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Splitting a single line into multiple lines
I have a case where, I need to look into a file.
Go to each line of the file, find the length of the line, if the length of the line is more than 75 chars, I need to split the line into multiple lines of 75chars max. If the length of the line is less than 75, we need not do anything. So at the end of this operation , maximum length of anyline in the file should be only 75. Ex: file having 3 lines 1st line: 20chars 2nd line: 85chars 3rd line: 160chars after the executing the script, The file should be 1st line:20 chars 2nd line: 75 chars 3rd line: 10 chars 4th line: 75 chars 5th line: 75 chars 6th line: 10 chars Thanks for your help |
| Forum Sponsor | ||
|
|