Ubuntu :: Line Breaks When Opening Text Files In Windows?

Mar 26, 2010

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...

View 9 Replies


ADVERTISEMENT

Ubuntu :: How To Apply Breaks In Text Files

Mar 31, 2011

I do not know what happened. But when I move the text files back and forth between Windows and Linux, the enters/paragraphs gets messed up and square characters appears. And I think it got worse when I deleted those squares. So now it is one very long line. How do I get the long line to break every 50 characters but not having the last word get cut off mid-word? I am thinking "cat textfile > something" but I do not know what that something is.

View 1 Replies View Related

Ubuntu :: Can't Text When The Menus Come Up Or When Opening A File From The Cd Or Curraculum On Line?

Feb 3, 2010

The problem that I am having now is that I can not is the text when the menus come up or when opening a file from the cd or curraculum on line. I have cairo-dock running and a conky running. Could this be the couse of my problem? I was going to uninstall and reinstall packet tracer but I am unsure on how to uninstall.

View 1 Replies View Related

Software :: Join 2 Text Files Based On First Number Present In Every Line Of The 2 Text Files?

Jan 22, 2010

I have 2 text files : file1.txt and file2.txt

cat file1.txt

15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces

cat file2.txt

2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2

I would like to join these 2 files. The result should look as follows :

cat joinedfile.txt

2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2

==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?

View 4 Replies View Related

Ubuntu :: Opening Executable As Text Files?

Oct 29, 2010

So I have Python file :

Code:
#!/usr/bin/env python
print 'python'
raw_input('')
And another :

[Code]....

as it should. I don't want to take such a hassle always running python by path.

View 4 Replies View Related

Programming :: BASH: Each Line Of Multiple Text Files Gets Added To One Line?

Sep 12, 2010

I currently have 3 files with floating point data that I wish to have in a single file with the format:

Code:

F1 F1 F3 Output
a1 b1 c1 a1 b1 c1
a2 b2 c2 a2 b2 c2
a3 b3 c3 a3 b3 c3
a4 b4 c4 a4 b4 c4

View 3 Replies View Related

Ubuntu :: Remove Warning When Opening Text Files?

Jun 20, 2010

I really hate this warning when I try to open certain types of files in gedit: (using ubuntu lucid)

Quote:

Do you want to run File.c or display its contents?

"File.c" is an executable text file.

Open in Terminal; Display; Cancel; Run

Is there any way to remove the warning? I have never once clicked anything other than display, and when I'm opening lots of files, having to hold down ALT-D to get rid of these warnings.

View 6 Replies View Related

Programming :: Open Two Text Files - Read Them Line By Line And Update Parameters Of The 3rd File ?

Oct 18, 2010

I have two txt files containing x and y coordinates: xcoord.txt & ycoord.txt. I need to open them; read them line by line to get each coordinate; then each time I need to update Xs and Ys parameters inside another file called "dc.in" with the grabbed values.

Finally each time I need to run two exe files ( dc_2002 and st_vac) and produce corresponding output for each Xs and Ys ( dc.in is an input file for this exe files)

I have written the following code but it does not work:

View 14 Replies View Related

General :: Match And Combine 2 Text Files Line By Line

Mar 21, 2011

This solution works but is slow with large files. I am looking for a faster solution.

The 2 files contain filenames, one of them has associated data I want to append to the other file's matching filenames

file1:

file2:

I append file2 by matching the unique_filenames and appending them with the tag data and some formatting

appended file2:


Here is the SLOW code

while read inputline.

View 9 Replies View Related

Programming :: Using Python To Merge Two Text Files Line For Line

Jul 6, 2010

I'm a bit new to Python programming and hoped that someone might be able to help with a problem I'm having. What I essentially want to do is to combine two text files line for line. I know how to do this in a bash script so to give you a better idea here's the code for that:

Code:

This is basically for adding on values to the end of a CSV file that uses ';' as the delimiter. So say file1 said:

And file2 said:

Then running this command would create merged_file1_and_file2 which would be:

The code I'm using at the moment is:

Code:

As I'm sure any experienced python programmer will see, this prints out the first line of the file "csvraw" and then all of the lines of "stamps" and then the remainder of "csvraw".

What I'd like to do is something like: (pseudo code, I know it's not python ;-))

Code:

Is this possible? I've tried googling and my Python Pocket Reference hasn't been much help. I've looked at pickling but that doesn't seem appropriate.

View 1 Replies View Related

Ubuntu Installation :: Localhost Not Opening Php Files Text Editor?

Jun 17, 2011

localhost not opening php files text editor

View 1 Replies View Related

General :: Opening Files In Text Editor From The Terminal

Mar 7, 2010

Using ubuntu 9.10

If I'm in a terminal window, and I open a file by typing eg :

It opens as a blank document... I know it has text in it though!

I've tried with other files and also with nano so it's not just a problem with a particular file.

How do I view the current contents of the file so I can then edit it?

View 4 Replies View Related

Ubuntu :: Opening .disk Files From Windows

Feb 20, 2010

I have another thread going about my issue but i have go no responses so i have been trying to fix it myself so on my journeys i thought it would be helpful if i could open my .disk files so i can access the logs so i can see what errors im getting. other thread is [url]

View 1 Replies View Related

Red Hat / Fedora :: Remove Particular Line Of Text From All Php Files

Jul 21, 2010

My site was recently hacked and a line of <JAVASCRIPT> was inserted into all my php files. Is there a way to pull just that one line out of all the php files on the server? I was thinking of using a grep -iR <CODE> *.php then piping thru sed

View 1 Replies View Related

Ubuntu :: Copy A Line By Number In Text Files On Terminal?

Apr 10, 2010

I got a text file. Now I want to write a line by its number in a bash variable. That is all.

View 1 Replies View Related

General :: SQL Like Group By And Sum For Text Files In Command Line?

May 2, 2010

I have huge text files with two fields, the first is a string the second is an integer. The files are sorted by the first field. What I'd like to get in the output is one line per unique string and the sum of the numbers for the identical strings. Some strings appear only once while other appear multiple times. Given the sample data below, for the string glehnia I'd like to get 10+22=32 in the result. how to do this either with gnuwin32 command line tools or in linux shell?

[Code]...

View 2 Replies View Related

General :: Replacement On More Than One Line In Text Files Using Shell

Nov 25, 2010

How can I replace one instance of a word in a text file with a piece of text that spreads several lines ? I know sed or awk is the way to go but don't know that how I can introduce new paragraphs using these tools

View 1 Replies View Related

Ubuntu :: Command Line - Find And Replace Text Within Multiple Files?

Aug 28, 2010

I'm pretty sure this is doable from the command line, but my CLI skills have degraded a lot since my pre-Y2K admin days. The goal is to search all the files in the directory for a very long string of text and replace it with another string of text. The text being searched for is my Google Adsense code (which will be stripped from my website) and it will be replaced with a placeholder so I can easily tack something else in there in the future.

Seeing how I have that long snip of code on about 100 pages, automating the process would make life easier.
If I was searching for a single word, I can see ways to do this.
If I paste the code I'm searching for into a text file, is there a way to:
find (contents of oldstring.txt) and replace with (contents of newstring.txt)?

View 9 Replies View Related

OpenSUSE :: Count Lines In Multiple Text Files From Command Line?

Apr 27, 2010

I want to (from the command line) be able to counte lines in a bunch of files of a specific type in a folder and all its sub-folders. How would I do this?

View 1 Replies View Related

Ubuntu :: Text In Shell Breaks Up?

Jun 7, 2011

I work a lot with Unix bash shell environment. Whenever I go down the directory tree to several subdirectories, i.e., /home/a/b/c/d/ and so on and type in a long command, what happens is that command text wraps around onto the new line but when trying to edit command I can only go back to the beginning of the new line. So, for, instance, say I go to directory and type something like:

/home/a/b/c/d/find . -type f -exec sed -i <- end of line
's/blah/blah/g' {} ; <- new line

Here, the problem is I can't go back to the real beginning of my command that starts with "find", I can only scroll to the beginning of the new line with the part "'s/blah/blah/g' {} ;"

So I effectively loose control over what I typed and can't edit it when the command wraps to a new line. Does anyone else experience this problem?

I also have this problem on our Debian servers so I always have to make sure I type the right command the first time because I can't move back and forth to edit it when it wraps to a new line.

View 9 Replies View Related

General :: Vim - Get Rid Of The Line Breaks?

Sep 26, 2009

I've copied a bunch of text into vim and I need to get rid of the line breaks. I've tried

:%s/^M// (where ^M is C-v C-m)
and
:%s/.$//
and

[code]....

all lines are terminated with a '$'. How can I get rid of them?

View 3 Replies View Related

Ubuntu :: Read Text Files In Windows?

May 25, 2010

A real os should at least e able to read and write plain text, you think? But no, when I try to open my text files (mainly made with gedit) some characters are ass, swedish letters rarely work and ', ", / and so on are not represented as the characters I want to see. Is there a easy, fast way to read (and print!) my text files at school, where they have only windows, without spending half an hour fixing the file by hand?

View 6 Replies View Related

General :: Convert Text Files Between Windows(Dos)?

Jan 24, 2010

What is a good way to do it? I have been trying to do it using sed.

View 9 Replies View Related

General :: Remove Line Breaks From Lines Ending With A Comma?

Nov 10, 2010

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:

A,B,C
D,E,
F
G,H,I

becomes:

A,B,C
D,E,F
G,H,I

View 1 Replies View Related

General :: Copy Text Files From System To Windows?

Jun 7, 2010

I am running some Pcap files through editcap and then tshark. I am running fedora 11. This will create a couple of thousand text files all numbered sequentially 1-x. How can I copy these files across a network(I connect using putty) or how can I copy them onto an external HD so that when I view them on the windows machine they have the right formatting (Windows know to open them with wordpad/notepad) basically that windows knows that they are text?

View 11 Replies View Related

General :: Command Line - Use Find To Find Text Files?

Jul 15, 2011

Is there a way to specify to find that I only want text files (and not binary files)? Grep has an option to exclude binary files, so I thought find probably has a similar feature, but I've been unable to find it.

View 2 Replies View Related

Programming :: Delete Line Of Text From Text File Via Shell?

Jan 13, 2010

I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.

View 3 Replies View Related

Software :: Grep Query To List 1 Line (which Is Fixed) And The Next Line After It (variable Text)

Jan 20, 2011

How can I list the following with grep. I want to extract 2 lines fron a text file The fixed known part if it exists will static text and the text line after it will change.

A sample file
.
.
textline1

[code]....

If the fixed part does Not exist how can I return error code 1

View 3 Replies View Related

Programming :: Add Text Before Line Number In Text File?

May 3, 2010

a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.

View 16 Replies View Related

Programming :: Perl - Delete Line From Text File With Duplicate Match At Beginning Of Line

Apr 1, 2009

Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):

There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.

If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved