Change file content 4 column to one Column using script

Hi Gurus,

I have file content sample:

,5113955056,,TAgent-Suspend
,5119418233,,TAgent-Suspend
,5102119078,,TAgent-Suspend

filenames 120229H5_suspend, 120229H6_unsuspend

I receive those files one of directory /home/temp/

I need following:

1. Backup first /home/temp/ file to /home/bak

2. File content will be changed to only one column:

5113955056
5119418233
5102119078

3. File *_suspend, *_unsuspend will be transferred to following directories:

/home/suspend/*_suspend
/home/unsuspend/*_unsuspend


4. That Script will put in Crontab for doing the operation 4 times a day. Checking /home/temp file, if present do the above operation.

5. Need a output log of that script: File processed done or No file found.

Need you help to develp the script please.

And your attempt to arrive at a solution to the problem would be?

actually I am new to script. Main issue is Step: 2 "File content will be changed to only one column"

I need help to write the script.

Hi thepurple,

It's not clear for me.

For example, step 1: You have two files

and want to copy them to

Is like this?

And step 2, content of which file?

Regards,
Birei

content of 120229H5_suspend which is in 4 column. Need to make it 1 column

You can use

cut -d, -f2 infile > outfile