Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX rename with Regex to remove middle string from file names Post 303044296 by genehunter on Tuesday 18th of February 2020 09:07:49 AM
Old 02-18-2020
Yes, sorry.. that was sloppy copy pasting.
Edited to correct it
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem to add the string(without sed & awk) into the middle of file

Hi, I have tried many times to add the string into the first line of the file or the middle of the file but could not find the solution. I first tried by $echo "paki" >> file This code only append paki string at the end of file "file" but how can i add this "paki" into the first line or... (5 Replies)
Discussion started by: ali hussain
5 Replies

2. Shell Programming and Scripting

add a string in the middle of the file

i want to add a string in a very top of a file without using VI or SED or AWK this is what ive done: (echo '0a'; echo 'LINE OF TEXT'; echo '.'; echo 'wq') | ed -s myfile to add astrng right in the middle i could have count the lines of the file and just chenge the address. ... (6 Replies)
Discussion started by: ciroredz
6 Replies

3. UNIX for Dummies Questions & Answers

Add string to middle of a file

Hi, I want to write a script that takes a file and a string as params and adds the string to the middle line of the file. Also, I want to output the results back to the original file passed without using temp files. I am very much new to UNIX so this is all a little like black magic to me at... (15 Replies)
Discussion started by: Chiefos
15 Replies

4. Shell Programming and Scripting

Find and rename long file names (html)

Hi Guys, I need a help. I have 1130 zip files. Each one of them has files including 1 html file with long file name (includes special charactors, Alphabetic and numbers). I have copied all 1130 zip files to my linux system and extracted using below command. Find . -name "*.zip" -exec... (7 Replies)
Discussion started by: Rajmani
7 Replies

5. Shell Programming and Scripting

Unix File - Adding columns in the middle

Hello, I have a comma separated flat file. It contains some 20 columns. I want to add two new columns at position 2,3. So that file will have 22 columns. I am providing here sample data with file having 4 columns. Appreciate your help in finding solution for this. data in input file:... (11 Replies)
Discussion started by: ravi.videla
11 Replies

6. Shell Programming and Scripting

Rename multiple file names in a directory

I hope some one can help me I have multiple files in a directory with out extension like as below mentioned. But i want to change all the file names along .DDMMYYYYHHMISS format. And all files should have same DDMMYYYYHHMISS. Scenario: direcory name = /vol/best/srcfiles files in a... (4 Replies)
Discussion started by: hari001
4 Replies

7. Linux

Remove newline in middle of string

my file input is with tab as delimiter, and in every line, there would be a skip of line with an unexcepted newline breaker. I'd like to remove this \n and put the information in the same line. INPUT a1 b1b2 c1 c2 d1 a2 b3 c3 d4 OUTPUT a1 b1b2 c1c2 ... (9 Replies)
Discussion started by: kinkichin
9 Replies

8. Shell Programming and Scripting

Grep string in files and list file names that contain the string

Hi, I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat. My OS is: SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
Discussion started by: apenkov
8 Replies

9. Shell Programming and Scripting

How to rename multiple file names?

Hi all, I need to rename more file name in one command or script. The files have this structure: XxY - filename.doc where X and Y are numbers and the x is the letter itself. I need to rename these files with this structure: string.S0XEY.filename.doc the string is a suffix that... (8 Replies)
Discussion started by: idro
8 Replies

10. UNIX for Beginners Questions & Answers

Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX?

My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data. ... (7 Replies)
Discussion started by: chandrath
7 Replies
draai(1)							  USER COMMANDS 							  draai(1)

  NAME
      draai - manage playlists and play audio files

  SYNOPSIS
      draai [option [option ...]] command [track [track ...] | tracknumber [tracknumber ...]]

  DESCRIPTION
      Draai  is  a wrapper around mpc, making playing music from the commandline more enjoyable. mpc is a client for MPD, the Music Player Daemon.
      Using draai, one can play an audiofile (ogg, mp3, flac, whatever your MPD offers), play all files in a predefined playlist, view details	on
      current, past and future playing songs, skip to the next song, etc.

  GETTING STARTED
      Run "draai init" to get started using draai the way the author likes it.	Other ways of using draai are possible, see below.

  COMMANDS
      draai
	Play music.
      init
	Start a bunch of X terminals setting up some draai jobs: tail, logtail, peek, syslog, ...
      guestlist
	Reschedule  listed tracknumbers as upcoming tracks. Last arguments should be the positions of tracks to be put on the guestlist, not file-
	names.
      unguestlist
	Reschedule listed tracknumbers to end of playlist.
      insert
	Add file to playlist and schedule it as upcoming track.
      tail
	Print information about track when it starts playing, similar to tail -f on a logfile.
      logtail
	Run tail(1) on system log file.
      list
	List current playlist.
      peek
	Show status of current song, and show upcoming $peek FIXME tracks.
      syslog
	Send raw information from tail to syslog. You likely want to run "draai syslog" in the background.
      skip
	Skip this track, start playing the next one now.
      osjittisstil
	Run this if unwanted silence pops up during a playing session (for now, it runs draai --sloppy skip).
      delete
	Delete track(s) from current playlist. Last arguments should be _positions_ of tracks to be removed,  not  filename.  If  no  position	is
	given, deletes upcoming track from playlist.
      fastforward
	Seek forward in current track.
      quit
	quit

  OPTIONS
      --debug (debug), -d
	Be very verbose.
      --playlist (with playlistfile), -p
	Playlist file; option can be supplied more than once. To be used with command "draai".
      --noshuffle (no shuffle), {-S}
	Don't shuffle tracks and leave random mode untouched (default is: do shuffle and disable random mode). See also the script dr_unsort.
      --raw (raw), -r
	Print raw stuff, suitable for postprocessing (if combined with tail, peek or list).
      --sloppy (sloppy), -s
	Don't try hard to make everything sound smooth. If combined with skip: risk a squeak on old hardware.
      --time (with timespec), -t
	If combined with commands quit or draai: time at which to quit or start.

  ENVIRONMENT
      Run  grep DR_ `which draai` to find out about environment variables honored by draai. It honors: booleans: DR_DEBUG and DR_SHUFFLE, DR_TIME-
      STAMP, DR_RAW and DR_SLOPPY ; strings: DR_WATCH ; integers: DR_CROSSFADE, DR_PEEK and DR_SEEK as well as DR_FADEOUT_STEP, DR_FADEOUT_REPEAT,
      and  DR_FADEOUT_SLEEP  and DR_VOLUME_STEP ; and some more strings: DR_SYSLOG_FILE, DR_SYSLOG_FACILITY and DR_SYSLOG_LEVEL . For now, see the
      draai code for what it all means.

  FILES, CONFIGURATION
      All configuration variables (see ENVIRONMENT) can be set in ~/.draai/rc.	This rc-file is sourced as a shell script. If you'd  like  to  set
      the  syslog  facility, set syslog_facility (overruled by DR_SYSLOG_FACILITY). If you'd like to set the watch programma, set watch (overruled
      by DR_WATCH).

  SEE ALSO
      Lots of alternatives for draai exist. One is "herrie", by Ed Schouten and Martijn van den Dungen, see http://freshmeat.net/projects/herrie/.

  COPYRIGHT AND LICENSE
      Draai is (C) 2000-2008 Joost van Baal <joostvb-draai@mdcc.cx>.  Draai is free software; you can redistribute it and/or modify it	under  the
      terms  of the GNU General Public License, as published by the Free Software Foundation, either version 3 of the License, or (at your option)
      any later version. This program is distributed WITHOUT ANY WARRANTY. You should have received a copy of the GNU General Public License along
      with draai. If not, see http://www.gnu.org/licenses/.

  AUTHOR
      Joost van Baal <joostvb-draai@mdcc.cx>

  draai 20110603						     03 juin 2011							    draai(1)
All times are GMT -4. The time now is 09:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy