cat

problem using cat in windows

I'm using the windowsxp. The version of 'cat' that I'm using comes bundled with the arduino download. The makefile runs cat. Here is the output: cat \arduino-0012\hardware\cores\arduino\main.cxx >> applet\foo.cpp cat: arduino-0012hardwarecoresarduinomain.cxx: No such file or directory make: *** [applet_files] Error 1 I also tried t...

Filenames and linenumbers for the matches of cat and grep

My code $ *.php | grep google How can I print the filenames and linenumbers next to each match? ...

Why is my "cat" function with system calls slower compared to Linux's "cat"?

I've done this function in C using system calls (open, read and write) to simulate the "cat" function in Linux systems and it's slower than the real one... I'm using the same buffer size as the real "cat" and using "strace" I think it's making the same amount of system calls. But the output from my "cat" is a little bit slower than the ...

Passing directory contents as a single line to an executable in Powershell

I have a binary executable that takes a list of file paths as arguments, e.g., C:\Tool.exe C:\Files\File1.txt C:\Files\File2.txt I would like to call this tool from Powershell. The question is, how can I get the output of get-childitem all on one line? If I run: ls C:\Files\*.txt | select FullName I get one path per line. H...

Remove strings after each first word in a text file

File1: hello (OPTION1) 123456 123456 123456 world (OPTION1) 123456 123456 123456 foo (OPTION1) 123456 123456 123456 bar (OPTION1) 123456 123456 123456 How would one remove each string after each first word in the textfile File1? This would probably be down with awk/sed/cat - but I cannot figure it...

Microsoft Security Catalog Format Documentation and API Samples

I'm looking for any documentation on the API for working with Microsoft Security Catalogs, or in lieu of that, information on the file format so that I may write my own parser. In short, I have some .cat files that I need to be able to work with. Looking at the file in a hex editor, they obviously have different regions, which are deli...

Simplest method to get the dictionary definitions of a list of words in a text file

File1: hello world I don't know the best method to extract a list of words from a text file, find their definitions and paste them into an output textfile. I've been thinking of using WordNet - but don't know how to automate the process. Does anyone have any ideas (perhaps google/APIs/linux applications) that one could use to find th...

Remove empty new lines in a text file via grep

FILE: hello world foo bar How can when remove all the empty new lines in this FILE? Output of command: FILE: hello world foo bar ...

Send the result of multiple commands to one text file?

This is what I have so far - my dropbox public URL creation script for a directory of public URLs (getdropbox.com - gpl I think). My LIST file was created using ls in the following fashion: ls -d ~/Dropbox/Public/PUBLICFILES/* > LIST dropboxpuburl.sh: for PATH in `cat LIST` do echo $PATH dropbox puburl $PATH > ~/URLLIST/$PATH d...

Remove a variety of lines in a text file

I've been trying to implement a bash script that reads from wordnet's online database and have been wondering if there is a way to remove a variety text files with one command. Example FileDump: **** Noun **** (n)hello, hullo, hi, howdy, how-do-you-do (an expression of greeting) "every morning they exchanged polite hellos" **** Verb **...

Reformat a large text file into one line strings (via BASH)

File1: hello - dictionary definitions: hi hello hallo greetings salutations no more hello for you - world - dictionary definitions: universe everything the globe the biggest tree planet cess pool of organic life - I need to format this (for a huge list of words) into a term to definition format (one line per term). How can one achieve...

Preserving leading white space while reading>>writing a file line by line in bash

I am trying to loop through a directory of text files and combine them into one document. This works great, but the text files contain code snippets, and all of my formatting is getting collapsed to the left. All leading whitespace on a line is stripped. #!/bin/sh OUTPUT="../best_practices.textile" FILES="../best-practices/*.textile" fo...

cat filename.* > Datei

I'm looking to translate the unix-command $ cat filename.* > Datei into a Python program. Can somebody help ? ...

Unix cat command

I am joining about 20 files with a total size of 40Gb using the following command. cat hda1.ntfs-ptcl-img.gz.* > hda1.ntfs-ptcl-img.gz Just wondering how long this process should usually take as it has been running for some time now. Thanks. ...

Need some help understanding the MATLAB `cat` command in high dimensions

The commands a = magic(3); b = pascal(3); c = cat(4,a,b); produce a 3-by-3-by-1-by-2 array. Why is the result 3-3-1-2 when the dimension is 4? ...

Why Does Piping Binary Text to the Screen often Horck a Terminal

Imaginary Situation: You’ve used mysqldump to create a backup of a mysql database. This database has columns that are blobs. That means your “text” dump files contains both strings and binary data (binary data stored as strings?) If you cat this file to the screen $ cat dump.mysql you’ll often get unexpected results. The terminal ...

Concatenating a folder of quicktime files together.

I know on my linux box I can use: cat file1.mov file2.mv file3.mov > combined.mov But in OSX this doesn't seem to work. Only the file1.mov is combined. Any work arounds for OSX? Thanks ...

unix - how to deal with too many args for cat

I have a bunch of files in a directory, each with one line of text. I want to cat all of these files together (all the one liners) into a single, large file. However, when I use cat there are too many arguments. How can I get around this? ...

Bash: "xargs cat", adding newlines after each file

I'm using a few commands to cat a few files, like this: cat somefile | grep example | awk -F '"' '{ print $2 }' | xargs cat It nearly works, but my issue is that I'd like to add a newline after each file. Can this be done in a one liner? (surely I can create a new script or a function that does cat and then echo -n but I was wonder...

How to remove ˆM chars?

I have a file generated from windows that I have to paste into a script under linux. My script works fine, except for the fact that at the end of every line I got a ^M char. How can I remove it with bash? Currently my script is: #/bin/bash IFS=$'\n' for CUSTOMER in `cat exp.csv` do echo $CUSTOMER done ...