@echo off
SET "CDIR=%~dp0"
:: for loop requires removing trailing backslash from %~dp0 output
SET "CDIR=%CDIR:~0,-1%"
FOR %%i IN ("%CDIR%") DO SET "PARENTFOLDERNAME=%%~nxi"
ECHO Parent folder: %PARENTFOLDERNAME%
dir /b /o:n *.tif *.eps *.png *.jpg > %PARENTFOLDERNAME%.csv
exit
--------------------------------
Headers Column A1"Find" Column B1"Change"
List files in B1"Change"
Add a formula in A1"Find"
Input and Output files in the link below.
Input file https://fromsmash.com/aAOU6Hv3py-dt
Output file https://fromsmash.com/5LPuvbLuTL-dt
need to add header and add a formula
Moderator: DosItHelp
Re: need to add header and add a formula
I've seen that both your input and output files are .xlsx. This is a compressed file format that batch is not able to work with.
Steffen
Steffen
Re: need to add header and add a formula
I have attached the csv files.
- Attachments
-
- Input-file.csv
- Input File
- (296 Bytes) Downloaded 352 times
-
- Output-file.csv
- Output File
- (409 Bytes) Downloaded 311 times
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: need to add header and add a formula
How do you know which "formula" goes with which column? It feels completely arbitrary.
Re: need to add header and add a formula
need to add this formula in below row of Find Header:
=INDEX({"IFig";"SFig";"Fig";"CFig"},MATCH(MID(LEFT(B2,FIND(".",$B2)-1),10,1),{"a";"s";"f";"c"},0)) & VALUE(MID(LEFT(B2,FIND(".",$B2)-1),11,2)) & MID(LEFT(B2,FIND(".",$B2)-1),13,99)
=INDEX({"IFig";"SFig";"Fig";"CFig"},MATCH(MID(LEFT(B2,FIND(".",$B2)-1),10,1),{"a";"s";"f";"c"},0)) & VALUE(MID(LEFT(B2,FIND(".",$B2)-1),11,2)) & MID(LEFT(B2,FIND(".",$B2)-1),13,99)
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: need to add header and add a formula
You're going to want VBA for this. Batch can't help with Excel.
Re: need to add header and add a formula
can add column header using batch?
i will copy paste the formula
i will copy paste the formula