Skip to main content
edited body; edited tags
Source Link
Ooker
  • 665
  • 1
  • 8
  • 22

To paste many files, whose names are incremental numbers:

paste {1..8}| column -s $'\t' -t
  • What if your files wasn't named by number, but only words?
  • It can be up to ten files, what should I do?

In addition, you have a list of files that contains all the files you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.


Actually my files have the same name, just on different directionlocations, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...

To paste many files, whose names are incremental numbers:

paste {1..8}| column -s $'\t' -t
  • What if your files wasn't named by number, but only words?
  • It can be up to ten files, what should I do?

In addition, you have a list of files that contains all the files you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.


Actually my files have the same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...

To paste many files, whose names are incremental numbers:

paste {1..8}| column -s $'\t' -t
  • What if your files wasn't named by number, but only words?
  • It can be up to ten files, what should I do?

In addition, you have a list of files that contains all the files you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.


Actually my files have the same name, just on different locations, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...
Fixed some spelling/grammar.
Source Link
polym
  • 11.1k
  • 10
  • 45
  • 66

To paste many filefiles, whose names are incremental numbernumbers:

paste {1..8}| column -s $'\t' -t
  • What if your files wasn't named by number, but only words?
  • It can be up to ten files, what should I do?

What if your files didn't be named by number but only words, and it can up to ten files, what should you do? In addition, you have a list fileof files that contains all the filefiles you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

 

Edit: Actually my files have athe same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...

To paste many file whose names are incremental number:

paste {1..8}| column -s $'\t' -t

What if your files didn't be named by number but only words, and it can up to ten files, what should you do? In addition, you have a list file contains all the file you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

Edit: Actually my files have a same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...

To paste many files, whose names are incremental numbers:

paste {1..8}| column -s $'\t' -t
  • What if your files wasn't named by number, but only words?
  • It can be up to ten files, what should I do?

In addition, you have a list of files that contains all the files you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

 

Actually my files have the same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...
added 197 characters in body
Source Link
Ooker
  • 665
  • 1
  • 8
  • 22

To paste many file whose names are incremental number:

paste {1..8}| column -s $'\t' -t

What if your files didn't be named by number but only words, and it can up to ten files, what should you do? In addition, you have a list file contains all the file you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

Edit: Actually my files have a same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...

To paste many file whose names are incremental number:

paste {1..8}| column -s $'\t' -t

What if your files didn't be named by number but only words, and it can up to ten files, what should you do? In addition, you have a list file contains all the file you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

To paste many file whose names are incremental number:

paste {1..8}| column -s $'\t' -t

What if your files didn't be named by number but only words, and it can up to ten files, what should you do? In addition, you have a list file contains all the file you want.

So far, my approach is:

mkdir paste
j=0; while read i; do let j+=1; cp $i/ paste/$j; done<list;
cd paste; paste {1..8}| column -s $'\t' -t

I have no problem with this approach, I just want to ask if there is any shorter one.

Edit: Actually my files have a same name, just on different direction, for instance 1MUI/PQR/A/sum, 2QHK/PQR/A/sum, 2RKF/PQR/A/sum. The paste command should be paste {list}/PQR/A/sum. The list file is:

1MUI
2QHK
2RKF
...
Source Link
Ooker
  • 665
  • 1
  • 8
  • 22
Loading