Hi,
I have a file which is around 193 gb in size. This file has tonnes of spaces and I need to sanitize it.
I tried to use awk script to split this file but it gave me an error like line to long...
As of now I am using a sed command to search replace the spaces; however its too slow for such a big file.
Is there a better way to remove spaces from a file?
Another constraint that I have is I should not be touching the first two columns in the file even if they have spaces or not spaces.
Sed Command that I have used to get the job fast and also to ensure my first two colums are not touched :
sed 's/ *//g' bigfile > outfile
First Line from big file:----
; 00000000000000000000000000000000000000000000000000 ;/; ;111111111111338; ; ; ;/;/;/;/;/;/;/;/
;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/;/; ; ; ; ; ;
;/;00; ;I; ; ;2
0012;91; ; ;ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ; ;ONE ;
; ; ; ; ; ; ;2430 ;
; ; ; ; ; ; ;
; ; ; ; ; ; ;28 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX ST ; ;
; ; ; ; ; ;
; ; ; ; ; ;US;ENGLISH ;N
SW ; ; ; ; ; ;
; ; ; ; ;
; ;I; ; ;99991231;BAD ;11111111;X;G ; ;11111111; ;
;/;/; ;
;/;/;/;/; ;/; ;/;
;/;/;/;/;/; ;/; ; ; ; ; ; ;/;
;/;/; ; ; ; ; ;/;/; ; ; ; ; ; ;
; ;/;/; ; ; ; ;/;/;/;/;/;/; ; ;786643219987879875756; ; ; ;0009000789y969y7;200
10821; ; ;87147146 ;35042346 ; ; ; ; ; ; ; ;
; ; ; ; ; ; ; ; ;/;I; ;US;02 65578109 ; ; ;
; ;20090731 ;99991231 ; ; ; ; ; ; ;
; ; ; ; ; ; ;
; ;
; ; ; ; ; ; ; ; ; ;
; ; ; ; ; ; ; ;XXDEFAULT ;20010821;19990716; ;
; ;/; ; ; ; ; ; ; ; ; ;/;/; ; ;/; ;/;/;/;/;/
;/;/;/;/;/;/;/;/; ; ; ;/; ; ; ; ;