Sponsored Content
Top Forums Shell Programming and Scripting How do I remove everything after a certain character in text files? Post 302276781 by guitarscn on Wednesday 14th of January 2009 02:44:18 PM
Old 01-14-2009
Quote:
Originally Posted by agn
Code:
$ echo "foods: vegetables *baby carrots*cabbage*lettuce*tomatoes*" | cut -f 1,2 -d'*'
foods: vegetables *baby carrots

Where do you see multiple '*'s in the output ?
I just ran the command, it spit out everything, and I checked the file again, and everything was the same
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read list of filenames from text file and remove these files in multiple directories

I have a large list of filenames from an Excel sheet, which I then translate into a simple text file. I'd like to use this list, which contains various file extensions , to archive these files and then remove them recursively through multiple directories and subdirectories. So far, it looks like... (5 Replies)
Discussion started by: fxvisions
5 Replies

2. Shell Programming and Scripting

Sed or awk script to remove text / or perform calculations from large CSV files

I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
Discussion started by: metronomadic
6 Replies

3. Shell Programming and Scripting

Remove duplicate files based on text string?

Hi I have been struggling with a script for removing duplicate messages from a shared mailbox. I would like to search for duplicate messages based on the “Message-ID” string within the messages files. I have managed to find the duplicate “Message-ID” strings and (if I would like) delete... (1 Reply)
Discussion started by: spangberg
1 Replies

4. Shell Programming and Scripting

read the text file and print the content character by character..

hello all i request you to give the solution for the following problem.. I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print g go goo goog googl google like this Using unix Shell scripting... without using... (1 Reply)
Discussion started by: samupnl
1 Replies

5. Shell Programming and Scripting

how to remove all text including 2 certain character in each line!

Hi I have a file which has aroun 200 line and it is like this: GROUP2-WDI">GROUP2-WDI GROUP3-WDI">GROUP3-WDI KL2P0508BC">KL2P0508BC KL2P0508BIT">KL2P0508BIT KL3P0506BC">KL3P0506BC KL3P0506BUS">KL3P0506BUS KLD1F0507DBT">KLD1F0507DBT KLD1F0507DIT">KLD1F0507DIT KLD1F0510DBT">KLD1F0510DBT... (3 Replies)
Discussion started by: digitalmahdi
3 Replies

6. Shell Programming and Scripting

How to remove common file names from text files

I'm running on freebsd -- with a default shell of csh. I have two files named A and B. Each line of each file contains a file name. How can I write a script that removes all the file names in file B from A. I tried to use perl to create a huge regular expression with "|" separating the file... (2 Replies)
Discussion started by: siegfried
2 Replies

7. Shell Programming and Scripting

Script to search for a character in files in a Directory & remove it

Hi All, Am new to both Unix & this Forum - Need some help on a script that I am trying to write: In a Directory i have few text files which might or might not contain some text that I am trying to find. Once that text is found in any of the files, it needs to be removed from the file ... (6 Replies)
Discussion started by: rituparna_gupta
6 Replies

8. Shell Programming and Scripting

How to loop a text file to remove the old files?

Hi , I'm using Ksh 88 version. I've a text file which contains the directory names DIR1 DIR2 ---- DIR10 I've to remove the data which has more that 30 days from the above directories . The data has to be removed from the following path cd /home/etc/DIR1/hist cd /home/etc/DIR2/hist... (2 Replies)
Discussion started by: smile689
2 Replies

9. Windows & DOS: Issues & Discussions

Remove duplicate lines from text files.

So, I have text files, one "fail.txt" And one "color.txt" I now want to use a command line (DOS) to remove ANY line that is PRESENT IN BOTH from each text file. Afterwards there shall be no duplicate lines. (1 Reply)
Discussion started by: pasc
1 Replies

10. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies
TOMATOES(6)															       TOMATOES(6)

NAME
tomatoes - Tomatoes smashing game SYNOPSIS
tomatoes SYNOPSIS
I Have No Tomatoes is an extreme leisure time activity idea of which culminates in the following question: How many tomatoes can you smash in ten short minutes? If you have the time to spare, this game has the vegetables just waiting to be eliminated! NOTES
Before starting the game, you should know that the game uses OpenGL for hardware accelerated 2d & 3d graphics. This means that you must have fully OpenGL compatible graphics card in your PC. Your card also needs to be able to use 512x512 textures, and this rules out Voodoo 1, 2 and 3 (limited to 256x256 textures). As for the CPU and memory requirements, I'd recommend something along the lines of Pentium II (or an AMD equivalent) and 64MB. The game works on much slower systems as well, as the game skips frames if the system can't keep up with the 60 FPS rate; this ensures that the game runs at the right speed, you just don't get very smooth animation. This game features solid game play with beautiful OpenGL API driven isometric 3d graphics and nice music. It also includes a MOD player, and you can use your own MOD-type music in the game background. Just copy your XM/S3M/IT/MOD - files to the music subdirectory of I Have No Tomatoes and the game plays them. You can press F1 to skip a song when ingame. There's room for 128 MODs. Btw, if you don't have any MOD music, ModArchive (www.modarchive.com <URL:www.modarchive.com>) is a good place to download some. CONFIGURATION
You may also want to set some options, such as the screen resolution and color depth. By default, I Have No Tomatoes starts fullscreen in 800x600 resolution, 32bpp. To fine-tune the preferences to suit your PC better, open the file config.cfg in a text editor (Notepad will do). Under Unix this file is stored in ~/.tomatoes/. Most likely you'll be interested in these lines: o video_mode = 800 x 600 o video_mode_color_depth = 32 o video_mode_fullscreen = 1 o sound_enabled = 1 To set the resolution, change the video_mode - line (some common resolutions include 640 x 480, 800 x 600, 1024 x 768). Most common color depths are 16 and 32, and sometimes 24. video_mode_fullscreen controls whether the game starts in fullscreen or in a window. When running in windowed mode, you can use any resolution you want (the 4:3 aspect ratio modes are still preferred). If you don't have a sound card (or want to turn the sounds off), set sound_enabled to 0 (zero). Finally, if you want to know how many frames your system draws per second (FPS), set show_fps to 1. FPS should be over 60 for smooth anima- tion. The default keys can be changed from the Options menu in game, so no need change them here. When you're satisfied with the config.cfg settings, by all means, proceed to start the game :) AUTHOR
You can contact the author by email at <lsoft@mbnet.fi>. Notice that since 12th of July, 2004 I've been in the army, so don't expect imme- diate responses. Be patient :) This man page was compiled by Helge Kreutzmann <debian@helgefjell.de> for the GNU/Linux project but it may be used by everybody else as well. SEE ALSO
Tomates homepage: http://tomatoes.sourceforge.net <URL:http://tomatoes.sourceforge.net> tomatoes 23 May 2012 TOMATOES(6)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy