Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What tool/program/script can I use to manipulate files based on a list of filenames?

0
Posted

What tool/program/script can I use to manipulate files based on a list of filenames?

0

Well, tina, in this case once you have copied the list from Excel you could skip making a file and just use the pbpaste command to feed the clipboard right to xargs: pbpaste | tr ‘\n’ ‘\0’ | xargs -0 echo But if there were tens of thousands of records I would try to save that sheet as tab-delimited ASCII or UTF-8 right from Excel. The reason you got the warnings about \r is that Mac OS X text files use the UNIX line break, which is just an LF. CR/LF is the Windows line break, which Excel “helpfully” offered you, and the \r represents the CRs that Excel added.

0

Another neat thing you can do is use the ln (link) command instead of cp (copy); argument syntax is the same. This will not only be much faster, but it will avoid filling up your disk with redundant copies of your data. By default, ln makes hard links. Provided the files you’re marshalling and the directory you’re marshalling them into are in the same filesystem (which is usually the same thing as saying they’re on the same physical disk partition) then this is what you want to do. If the files could be anywhere, then add the -s option to ln and it will make symbolic links instead. Hard links are just extra directory entries for an existing file. They work just like the file’s original directory entry. By making a hard link to a file, you’ve effectively given the file an extra name. If a file has extra names created by hard linking, those names are all as “real” as the name the file had when first created, and you have to delete all of them to make the file actually disappear from the

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.