Hello,
What's the best way to split a large into multiple files based on the last digit in the first column.
input file:
f
2738483300000x0y03772748378831x1y13478378358383x2y23743878383802x3y33787828282820x4y43748838383881x5y5
the file is about 60Million records, and im using grep to do the splitting but i guess there must be a faster way. grep ^3.........."$i" ( where value of i is from 0 to 9 )
Apologies, i pasted a table .
assume the input file is one column as below:
fileIni
------
198760
676549
378763
376830
367389
378383
i need to split the above file in muliple files based on the last digit of each value in that column ( i.e ending with 0 in one file , ending with 1 in another , till 9 - of course maximum possible seggragation is 10 files)
so the above will go into these files:
file0
-----
198760
376830
Thank you,
i tried it with a file having 3 columns as i expected the spliting would be based on the last digit of the first column, but i had the splitting based on the last ( 3rd ) column.
can you help please?
if length is omitted, extracts to end of string like
${<string>:<start>}
if start is negative, counts from end of string, but it must be in (), like in the given script.
NOTE: first character has index 0.
look there : Manipulating Strings