I have a csv file that comes into my CentOS server that needs to be manipulated/parsed before it goes back out.
I've been doing a lot of searching and I'm not finding a way to copy some of the data (in each row). The file will come in with several rows but I'll only list one here for simplicity.
As in example a row will look like this:
, testuser, first_name, last_name, firstname.lastname@example.org
What I need to manipulate it to be:
, testuser, first_name, last_name, active
I'm not seeing a way to copy this first value in the row to also being the second value in the row AND remove that same value from being the fifth value in the row. It *might* be possible for me to get the input without the email address as the fifth value in each row, but I would still need to copy it to the second value. There is no way around that part.
Thanks for the read. As always any help is appreciated!