Search Results

Search: Posts Made By: Steven77
3,127
Posted By Franklin52
Something like this? awk '/RC...
Something like this?
awk '/RC No/{close(f);f=$4}{print >> f}' test.txt
3,127
Posted By Franklin52
/^RC No/ - Matches the pattern at the beginning...
/^RC No/ - Matches the pattern at the beginning of the line
NF means the number of fields and $NF means the last field
3,127
Posted By Franklin52
Or maybe something like: awk...
Or maybe something like:
awk '/^TD/{close(f);f=$2}{print >> f}' file
3,127
Posted By bartus11
Try:perl -n0e 'while...
Try:perl -n0e 'while (/TD.*?(?=TD|$)/sg){$x=$&;$x=~/TD:\s*(\w+)/;open $f,">>","$1";print $f $x; close $f}' file
3,366
Posted By sea
You could do a while read line, checking if line...
You could do a while read line, checking if line starts with 'As of'.
If so, write tempvar to file, otherwise fill tempvar.

eg:
VAR=""
while read line;do
[ "As of" = "${line:0:5}" ] && \...
3,366
Posted By soliton
Try csplit? [soliton@UAT:test]$ csplit...
Try csplit?
[soliton@UAT:test]$ csplit test.txt "/As of/+1" {*}
36
52
51
0
[soliton@UAT:test]$ cat xx00
aaaaa
bbbbbbb
cccccccccc
As of 2013
[soliton@UAT:test]$ cat xx01
ddddddddd...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy