I have a CSV file that's created in an application that can't output lines longer than 250 characters. the data fields, all together, are longer than this. how would I remove the line break from every line that ends with a comma? For example:
I have some text files (Just plain text files, not OpenOffice files or anything) and when I try to open them in Windows they are all one line. I think I read somewhere that Linux uses for new lines whereas Windows uses or something... I am using Kate to edit them, and I have a LOT of files to fix so...
I configured ( sendmail + Smarthost + pop-before-smtp settings + smtp auth settigns ), today i saw 18000 mail in mailq and somebody sending mail from my mailserver ,as i got reported by ISP for spaming. How someone broke the sendmail + pop-before-smtp settings. i usually access that system through webmin. Is webmin cause to hack password.
Or How someone break sendmail security without even choosing my own user / password spamper settings messages to smart hosts to yahoo / gmail with his own junk user name and password? I stopped sendmail for the time being. Any idea what i should look for and what i should go for its remediation?
I can't seem to find any info on a terminal command that lists the contents of a directory with page breaks so that I can view the contents of a very large folder (such as /usr/bin) because if I use ls, it prints so many names that scrolling up won't even cover all of them. We all know the obvious solution is to use a graphical file browser, but I tend to shy away from depending on graphical utilities simply because command line feels faster.
I have a hard drive with a bad PCB board. It stays on when not under heavy load and it will restart if I copy too much data off it. So far I have had good luck doing folders under 500 MB in size if I copy one folder to my good hard drive, wait five minutes, copy another, etc.
If I mount the bad drive and try to copy a folder of several GBs in size it will start and then stop as the hard drive restarts. When I try to mount the drive again Linux says it can't read the superblock. I have several folders with over 30 GB of data in many different folders.
What I am looking for is a way of copying a folder in Linux such that the commands grab the whole folder in chunks with a timed break in-between.
I have formatted a second internal drive as ext3. It worked fine until I copied (rsynch) my /home to the new drive. Now when I try to delete anything I'm forced to delete immediately or skip the deletion. I also tried moving the /usr/local directory to the second drive and it works fine, it doesn't break the Trash. I tried moving /home back to the root drive and the problem is gone. The second drive again works properly. I can reproduce this. The problem only occurs when I move the /home directory to the new drive.
# / was on /dev/sda1 during installation UUID=89a54f23-98ef-45d2-bef9-47d51992fd01 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation UUID=fb609b91-7322-4903-9309-2f0d3a6b87d4 none swap sw 0 0
# My shared volume /dev/sdb1 (show it on desktop) UUID=a726a583-03e5-47c6-9618-ddbfcdd4c1d6 /media/data ext3 defaults, users, exec0 0
I have several files with many lines something like this:
I'm trying to write a script that will count the number of characters per line that doesn't contain a ">" symbol and give me an average of those values. I have most of the script together but I can't figure out how to connect some of the steps.
I am trying to write a script that takes an input file ($FileName) and an intermediate file ($FileName.info) and removes lines from $FileName if the value in $2 of $FileName.info is <75.
I can't figure out how to feed only one line of the .info file to the if statement at a time so that it will perceive it as an integer instead of a list.
The error I am getting now is ./script.sh: line 6: [: : integer expression expected
I've written a script to parse a file and print each line that ends with matching pattern, if the next line is blank. The pattern lines are the result of md5sum $i|sed 's/path///g' so that only md5 and filename appear. Here's what I'm using.
Quote: for fline in `sed -n '/.*.ext$/p' file1` do if [ "`sed -n -e '/'"$fline"'/ {n; p;}' file1`" == "" ] then echo ""$fline" has no info" >>file2 fi done [Code]....
I am combining data from a couple different input files and creating an output file in a specific format. I notice that if I use the >> operator, information gets appended to a new line in my output file. This is useful, but if I'd like to append onto the CURRENT line, is there an easy way to do this? I've been googling around and see lots of complicated answers, nothing that suggests to me an easy way to do this. For example, if my output file looks like this:
b1a:] cat test hello my name is b1a:]
and I'd simply like to append "Bob", how can I do it? If I use
b1a:] echo Bob >> test b1a:] cat test b1a:] hello my name is Bob b1a:]
So what I would prefer is some command that would create the result:
I need to grep for a particular string and if found need to display the line containing that string, the line above that and also the first line of that paragraph.
Can this be done via sed.
Eg, My Paragraphs
OA connectA
Enclosure:
Interconnect Module #6 Status:
Here, if I grep for Critical, it should display the following
Similarly if I grep for Degraded, it should display
I have to do several scripts and I have no idea of how to do this one: Make a script that read line by line the passwd file and prints in console.Hope you understand couse my english isso bad as you can see.Our teacher told us something like this:#!/bin/bashwhile read line doecho $lineadone < dispositiveexit
I have a dataset (see example below) that I would like to go through and copy all lines containing a certain string ("LGIG") plus the line immediately following that line to a new file. I have no problem grepping lines containing the string LGIG but I'm lost how to translate that to line number and shift up one line number for each instance of that string.
I am using xterm and sometimes when typing long commands into a small window, the command extends beyond the end of the line. On my old uni setup, when this happens, the cursor moves to the line below and you can see what text you have typed above however on my slack 13 setup, it overwrites the current line so you cannot see what you have typed! How can I set xterm to move onto the next line instead of overtyping?
I have two files (not sorted) and need to compare line by line (i.e. first line of file1 to be compared to all the lines of file2 and so as for the rest of file1). Output will be an array of length of file2. Any suggestion in BASH other than a grep inside two read line loops ( which is time consuming for files ~1000s of lines).
Kernel 2.6.21.5, Slackware 12.0 Assuming I work in a text console (tty1,...,tty6) and that I have audio at Line In (the jack at the machine rear panel), how could I do to have it at Line Out?
I want to append at a new line if the old line is non empty. so it would be something like
Code:
1 2 3//dont add here
Code:
1 2 3 //add here
but if sometimes there could be extra empty line, then add at the empty line. So the script needs to detect whether or not the last line is empty. i figured out the symbol for a new line pattern is ^ so it would probably be sed "a^stuff here"is this right? but i dont seem to get the right result
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed. But i don't know how to do it. For example, I have a file
I have two files, file1.traj and file2.traj. Both these files contain identical data and the data are arranged in same format in them. The first line of both files is a comment.
At line 7843 of both files there is a cartesian coordinate X, Y and Z ( three digits ). And at line 15685 there is another three digits. The number of lines in between two cartesian coordinates are 7841. And there are few hundreds of thousands of lines in a file.
What I need to do is copy the X Y Z coordinate (three digits) from file1.traj at line 7843 and paste into file2.traj at the same line number as in file1.traj. The next line will be 15685 from file1.traj and replace at line 15685 at file2.traj. And I dont want other lines (data) in file2.traj get altered. This sequence shall be going on until the end of the file. Means copy and substitude the selected lines from file1.traj into file2.traj.
I tried to use paste command but I cant do for specified line alone.
Here i showed the data format in the file. I used the line number for clarity purpose.
I want to access a file, and check the length of every line.After, i want to check and replace all lines with length over 10 characters, with a message.Does anyone have a clue on that?
I am trying to write a program in C which compares two files and prints the line that is equal.
Here file1.txt has
and file2.txt has
Note: file2.txt consist of only a single string where as file2.txt has multiple lines. Actually im comparing two files with md5sum values.
Here is the code but it compares only first line of files..but it should compare the whole file1..and sorry iam a beginner in C can any1 sujest some modification to this code so that..it can compare file2 with entire file1