I have a text file in the following format:001|fileA002|fileA003|fileA004|fileB005|fileB006|fileC...xxx|fileXI need to split this file into the files corresponding to each |. The names of new files like fileA ,fileB,fileC...fileX . 
How can I Split a text file into new files
shell script;text processing
try awk -F\| '{ print $1 > $2 ; }' filewhere-F\| tell awk to use | as separator, | need to be escaped.> $2 redirect print to $2's value.in case of many ( > 10 ) files :for x in $(awk -F\| '!a[$2]++ { print $2}' file)do    awk -F\| -v f=$x '$2 == f { print $1}' file > $xdonefirst awk merely list uniq filename52 files are OK, this might get slow if hundreds of files.another alternative, provided field are safe to put in shellawk -F\| '{printf echo %s >> %s\n,$1,$2;}' file | bashbe sure to delete fileX before, in case of re-run.