Windows cmd line rename removes zeros from filenames? [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have a bunch of files that I need to rename :
XX_20_0001.pdf
XX_20_0001.xml
XX_20_0023.pdf
XX_20_0023.jpg, etc.
I made a bat file with this code in it:
rename "XX_20_*" "XX_083_*"
But for some reason it only leaves three digits at the end of the file name:
XX_083_001.pdf
Why? and how can I change this?
Thank you!
Maria

For DOS ren SourceMask TargetMask, the TargetMask is processed against the SourceMask (source name) strictly from left to right with no back-tracking. As 083 is one character longer than 20, so DOS will "eat" one character.

Related

Number of files in directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I am on Windows 10. I currently doing a group assignment that deals with a lot of images. I want to know when I click on an image if there is a way for the file explorer to tell me that this is "X" (for example 10th) item in this directory. I only see the total number of items on the bottom left corner of the file explorer screen. I know it sounds very nooby haha.
If PowerShell is an option:
ls | % {$i=1} { "$i $_"; $i++}
This will return:
1 file1.jpg
2 file2.jpg
3 file3.jpg
...

How to get to first character of Mac/Unix Command Prompt? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Driving me crazy! Say I'm typing on the terminal and I want to quickly get to the first character on the line, right now i use left arrow one press at a time and thinking there needs to be like a PAGE_HOME button to do that in the terminal, please help!? - Duncan Krebs
You can use CTRL+a to jump to the beginning of the line, and CTRL+e to jump to the end.

Insert a key within a line [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When I want to edit, insert a key in between characters of any line, the cursor deletes the characters to the right, instead of just sliding it over.
http://screencast.com/t/bOvK6wysxR
How to fix that?
Thanks for any input..:)
Press Insert on your keyboard, usually near the top right. This should, allow you to insert characters rather than over write them.

Displaying files in terminal line by line? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Is is possible, in terminal, to ls command a folder and view each file line by line instead of just spanning across horizontally?
Normal Display:
Assignment10.py Assignment12.py Excercise01.py Excercise03.py Excercise05.py Excercise07.py Excercise09.py README.txt
Assignment11.py Assignment13.py Excercise02.py Excercise04.py Excercise06.py Excercise08.py Excercise14.py Template.py
Ryans-MacBook-Pro-2:Learn_Python_The_Hard_Way_Excercises rschacht$
Preferred Display:
Assignment10.py
Excercise03.py
Excercise05.py
Excercise07.py
Excercise09.py
README.txt
ls is capable of doing that:
ls -1
(that's a one)

Bash - removing characters other than specific string [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I use wget -O to get the site text to a specific file.
It saves the file within ONE line. File has about 2 milion characters. After, I would like to remove any other characters different from "directory= ************" format (including quotation mark, **** stand for any text till second quotation mark).
Is there any smart way to acomplish that?
grep -o '"directory= [^"]*"' file
The smartest way would be to pipe it out to a smarter interpreter. Python for instance.
Python has a great regular expressions library at your disposal.

Resources