Jump to content

rossnixon

Active Members
  • Posts

    51
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rossnixon's Achievements

  1. I was hoping this would also work with jpeg2000 files, but it doesn't. Program output dimensions is just x, instead of 1611 and 1450 as in my jp2 image. image_1611x1450.jp2
  2. Thanks ioa747 ! That worked fine. It helped when I added the /console switch; which I don't recall using before.
  3. Tried but output dimensions using the example image showed as 0,0 instead of 400,400.
  4. Unfortunately this doesn't work with JP2 (jpeg2000) files.
  5. Is there any way to get an image's dimensions (pixels in X & Y direction) ? I can see the dimensions using one of the Windows File Explorer, details view, extra columns. My images are pretty much all the same size for a 'session', so this isn't too important. I can always 'hard code' this into each instance of my script and just put the dimensions in the filename.
  6. Hi all, if anyone still uses this forum... I don't think I need to post all my code, but it goes like this. I read in files of certain extensions from a directory using _FileListToArray() Should be no problem as I pulled this from an old working script from 2007. For each file, I have a function that creates new files with boilerplate text plus various text from the original file. Here is the first part of the function: Func ProcessFile($name)     $text = StringSplit(FileRead($name), @CRLF, 1)     $text2 = $header & "File" & ' "' & StringMid($name,1,stringLen($name)-4) & '.ecw"' & @CRLF & 'Type "RASTER"'& @CRLF          $minX = FileReadLine($name,line=5)     $maxY = FileReadLine($name,line=6) Error message is: $minX = FileReadLine($name,line=5) $minX = FileReadLine($name,^ ERROR Error: Unknown function name.
  7. Thanks Kidney, I hadn't spotted the String() function. Tested and works perfectly! :-)
  8. Now my problem is pulling the first element of the array into a string variable. Looks complicated! The example in help looks a bit like: _ArrayToString($fileArray, " :: ", 0, 0, @CRLF,0, 0) or _ArrayToString($fileArray, "", 0, 0) but they don't work.
  9. Thanks jchd. My error was treating the result as a normal variable instead of an array, so it showed as blank.
  10. I'm wanting to pull out some text using _StringBetween when the delimiters each side of the desired result are " characters. I've tried a few variations without success, e.g. _StringBetween($text, '"', '"') Is there some type of ASCII code I can use instead, perhaps? Thanks!
  11. Yeah OK. ; Look for all (,) pairs in the text $matchArray = _StringBetween($text, "(", ")") ; all pairs are now in an array ; first line $match1 = $matchArray[0] $splitMatchArray = StringSplit($match1, ",", $STR_NOCOUNT) $A1=$splitMatchArray[0] $A2=$splitMatchArray[1] $match2 = $matchArray[1] $splitMatchArray = StringSplit($match2, ",", $STR_NOCOUNT) $A3=$splitMatchArray[0] $A4=$splitMatchArray[1] ; second line $match3 = $matchArray[2] $splitMatchArray = StringSplit($match3, ",", $STR_NOCOUNT) $B1=$splitMatchArray[0] $B2=$splitMatchArray[1] $match4 = $matchArray[3] $splitMatchArray = StringSplit($match4, ",", $STR_NOCOUNT) $B3=$splitMatchArray[0] $B4=$splitMatchArray[1] ; third line $match5 = $matchArray[4] $splitMatchArray = StringSplit($match5, ",", $STR_NOCOUNT) $C1=$splitMatchArray[0] $C2=$splitMatchArray[1] $match6 = $matchArray[5] $splitMatchArray = StringSplit($match6, ",", $STR_NOCOUNT) $C3=$splitMatchArray[0] $C4=$splitMatchArray[1]I know I could have used nested FOR NEXT loops for this, but I would have had to use more complex variables(arrays) to store each number, then copied them into simpler variable names.
  12. Thanks SadBunny, that was a useful example. I got there in the end, but I won't post my code so as not to embarrass myself! :-)
  13. ​ $A = _StringBetween($text,"(",",") $A1 = $A[0] $A = _StringBetween($text,",",")") $A2 = $A[0] $A = _StringBetween($text,"(",",") ; oops same as 1st delimiters $A3 = $A[0]I'm getting $A1=1858720 and $A2=5861040, but $A3=1858720 again. I was hoping it would search further in the $text (whole file). Maybe I could somehow trim the $text each time?
×
×
  • Create New...