Skip to content
Advertisement

Linux cut, paste

I have to write a script file to cut the following column and paste it the end of the same row in a new .arff file. I guess the file type doesn’t matter.

Current file:

JavaScript

The output should be:

JavaScript

how can I do this? using a Linux script file?

Advertisement

Answer

JavaScript

Brief explanation,

  • ^([^,]*) would match the first field which separated by commas, and 1 behind refer to the match
  • (.*)$ would be the remainding part except the first comma, and 2 would refer to the match
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement