Report and read the Excel file

Hi all

I need to match the styles of paragraphs with Indesign and files the Excel file.

Excel file consists of (approximately 500 paragraph Styles) naming of the files of standard paragraph styles

Files InDesign with 100 paragraph Styles.

My request:

I need to generate the report if Indesign paragraph styles that are not in the Excel file.

for example,.

Indesign file Excel file

h1                             H1

h2                              h2

h3                              BL

tx                              tx1

TX1

TX2

Create the report as:

Paragraph error style is H1 and BL in Indesign file

Created script:

var myDoc = app.activeDocument;

var myPstyles = app.activeDocument.allParagraphStyles;

alert("myPstyles: " + myPstyles.length)

for(i=0; i<myPstyles.length; i++)
{
     var IndesignPStyles = myPstyles[i].name;
    alert(myPstyles[i].name)
    }
//_____________________________________________________________

//Help Here

var myFile = File.openDialog("Choose a tab delimitted txt file:");
if (!myFile){
exit();
}     
 
myFile.open('r');
while (myFile.eof==false){
     line=myFile.readln();
     line = line.split("\t");
     myFind = line[0];
}


Could someone help with this request.

Thanks in advance

Beginner_X

Hi BEGINNER_X,

First of all, you must convert the excel file to the format of files "*.csv or delimited by tabs. (I use commas .csv file).

You posted in above code JS reading only the names of paragraph style. Then another code is read only comma-delimited text file, but you are not comparing the paragraph style in the list of excel files. You missed here.

Please try the JS code below his works very well, but not generated the report file. I hope that you will generate the report of your side file.

var myFile = File.openDialog("Choose a tab delimitted txt file:");
if (!myFile){
exit();
}     

var myArray = []
myFile.open('r');
while (myFile.eof==false){
    var line=myFile.readln().split(",");
    myArray.push(line[0]);
    }

var myDoc = app.activeDocument;
var myPstyles = app.activeDocument.allParagraphStyles;

Array.prototype.contains = function(obj) {
    var i = this.length;
    while (i--) {
        if (this[i] === obj) {
            return true;
        }
    }
    return false;
}

var myMissingStyle =[];
for(i=2; i

THX,

csm_phil

Tags: InDesign

Similar Questions

  • Find and read the worksheet file target of target folder

    I'm trying to find and read the worksheet file target in the target folder. Help, please. Thank you.

    Build Path VI will solve the problem.

  • Download and open the Excel files on iPad Pro

    I have the new iPad Pro.  I have Office 365 is installed.  In my work, I run queries of data on a server and the query result comes to me in Excel.  I want to download the Excel file and open it for editing on my iPad Pro.  What I have actually / to accomplish this task?

    You should be able to do this by using numbers

    https://www.Apple.com/ca/support/iWork-for-icloud/numbers/

  • Read the Excel file

    Hi fellow coders, I need help on the topic of Excel files.

    Process of

    Read the Excel (5 worksheets) file > output is 5 table 2D > Covert table 2D in single array (Colum) > convert (String) data type of data (i/o, digital etc) > build Cluster table with table 2D data.

    I need help to interpret the secret 2D table in single table (Colum) > String convert to the relevant data type > building Cluster table with table 2D data.

    Happy coding

    Dave

    You could do something like this:

  • How to create and save the Excel file at the dam using java

    I'm trying to create an excel spreadsheet and save it in the dam. I am able to create Excel in the dam, but no data is it than excel. I use the following codes to create.

    String filename = "updatedMetadata.xls";

    FileOutputStream fos = new FileOutputStream (filename);

    Workbook WritableWorkbook is Workbook.createWorkbook (new File (filename));.

    WritableSheet writableSheet = workbook.createSheet ("update metadata", 0);

    Label = null;

    label = new Label (0, 0, "Header1");

    writableSheet.addCell (label);

    label = new Label (0, 1, "tête2");

    writableSheet.addCell (label);

    label = new Label (0, 2, "Header3");

    writableSheet.addCell (label);

    label = new Label (0, 3, "Header4");

    writableSheet.addCell (label);

    label = new Label (0, 4, "Header5");

    writableSheet.addCell (label);

    label = new Label (0, 5, "Header6");

    writableSheet.addCell (label);

    label = new Label (0, 6, "Header7");

    writableSheet.addCell (label);

    label = new Label (0, 7, "Header8");

    writableSheet.addCell (label);

    label = new Label (1, 0, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 1, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 2, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 3, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 4, "Col. val" "");

    writableSheet.addCell (label);

    label = new Label (1, 5, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 6, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 7, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 0, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 1, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 2, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 3, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 4, ' Col. val "" ");

    writableSheet.addCell (label);

    label = new Label (2, 5, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 6, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 7, "col val");

    writableSheet.addCell (label);

    Workbook.Write ();

    Workbook.Close ();

    ResourceResolver resourceResolver = request.getResourceResolver ();

    AssetManager Manager = resourceResolver.adaptTo (AssetManager.class);

    InputStream is = this.getClass () .getResourceAsStream ("/ content/dam/company/fileFolder /" + filename);

    Element element = manager.createAsset ("/ content/dam/company/fileFolder /" + name of file, is, "application / vnd.ms - excel", true);

    File is created in the path "/ content/dam/company/fileFolder / '.

    The file name is "updatedMetadata.xls".

    Thanks in advance

    Mahesh Narayanan

    I found it myself. I share the code so that in the future someone else can use it.

    String filename = "updatedMetadata.xls";

    ExcelFile to the file = new File (filename);

    Workbook WritableWorkbook = Workbook.createWorkbook (excelFile);

    WritableSheet writableSheet = workbook.createSheet ("update metadata", 0);

    Label = null;

    label = new Label (0, 0, "Header1");

    writableSheet.addCell (label);

    label = new Label (0, 1, "tête2");

    writableSheet.addCell (label);

    label = new Label (0, 2, "Header3");

    writableSheet.addCell (label);

    label = new Label (0, 3, "Header4");

    writableSheet.addCell (label);

    label = new Label (0, 4, "Header5");

    writableSheet.addCell (label);

    label = new Label (0, 5, "Header6");

    writableSheet.addCell (label);

    label = new Label (0, 6, "Header7");

    writableSheet.addCell (label);

    label = new Label (0, 7, "Header8");

    writableSheet.addCell (label);

    label = new Label (1, 0, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 1, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 2, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 3, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 4, "Col. val" "");

    writableSheet.addCell (label);

    label = new Label (1, 5, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 6, "col val");

    writableSheet.addCell (label);

    label = new Label (1, 7, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 0, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 1, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 2, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 3, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 4, ' Col. val "" ");

    writableSheet.addCell (label);

    label = new Label (2, 5, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 6, "col val");

    writableSheet.addCell (label);

    label = new Label (2, 7, "col val");

    writableSheet.addCell (label);

    Workbook.Write ();

    Workbook.Close ();

    ResourceResolver resourceResolver = request.getResourceResolver ();

    AssetManager Manager = resourceResolver.adaptTo (AssetManager.class);

    InputStream stream = new FileInputStream (excelFile);

    Element element = manager.createAsset ("/ content/dam/company/fileFolder /" + name of file, is, "application / vnd.ms - excel", true);

  • Create rectangles of information in the excel file... Help!

    I need help and have NO idea of what I'm doing. I have an excel file with thousands of lines, each with a column for the coordinate x, y-suface, the height and width of a rectangle. I need a script that will ask me to select the excel file, read the excel file and create rectangles of each of thousands of lines. I guess it would be simple enough for someone who knows what they're doing, but I have no idea where to start. I work in a windows environment and I have Illustrator CS4. Any suggestions? All scripts out there that could give me a start?

    you go, it's VBA code, I prefer to use it when I need to have Excel speak to Illustrator directly without exporting the data in Excel.

    to set up...

    -Open Excel

    -Press on Alt + F11 to bring up the editor

    -in the Tools menu, click references.

    -Add a reference to 'Adobe Illustrator CS5 type library' (or CS4 or your version)

    -in the perso.xls (or any other book) to add a Module. Personal is a comprehensive workbook that is always available. If you don't see it, go back to Excel and save a macro, anything will do. Who will create the personal folder.

    -type the following in this module

    Sub makeSquares()
        'carlos canto // 6/26/13
        'reads the active Excel workbook data to create squares in Illustrator
        'data is organized in rows as follows x, y, width, height
        'data has no headers, first row in cell "A1"
    
        Dim iapp As New Illustrator.Application
        Dim idoc As Illustrator.Document
        Dim isquare As Illustrator.PathItem
    
        Dim rowcount As Integer
        Dim x As Double
        Dim y As Double
        Dim w As Double
        Dim h As Double
    
        rowcount = Cells(1, 1).CurrentRegion.Rows.Count
    
        Set idoc = iapp.Documents.Add
    
        For i = 1 To rowcount
            x = Cells(i, 1)
            y = Cells(i, 2)
            w = Cells(i, 3)
            h = Cells(i, 4)
    
            Set isquare = idoc.PathItems.Rectangle(y, x, w, h)
        Next
    
        Set isquare = Nothing
        Set idoc = Nothing
        Set iapp = Nothing
    End Sub
    

    -Save the personal book

    -to run, move the cursor anywhere inside the slot... End Sub and press F5

    For simplicity, launch illustrator before running the script

  • Writing and reading the same excel file

    Hello.

    I wanted to write a few values in the excel sheet and after doing some math here I want to read the same file.

    Can I do this? Or there is a better way to accomplish the same task.

    Kindly help.

    Thank you

    To do this you don't need a file. See the attached example, I guess it will work

  • LabVIEW allows to read an Excel file to a control and add a checkbox for each line

    As say the topic, I need to use labview to read an excel file and show it in a control, such as mclb; I should add a checkbox for each line then allow me to choose the line I want. What should I do? Thank you very much.

    guiming wrote:

    I can read an Excel file to a spreadsheet, but I have no idea how to do to add a checkbox for each line.

    Sometimes, all you need to do is Google. https://decibel.NI.com/content/docs/doc-25000

    http://www.labviewing.com/check-box-in-multicolumn-ListBox/

  • Search and replace the contents of the excel file

    Hello

    I have the list in the excel file that needs to replace. The script should read the excel then replace to open InDesign documents.

    The excel (*.xls) file has two columns, the first column has our old. and the second column has the new numbers to replace.

    Ex:

    Column 1 column 2

    (Research)               (Replace)

    -----------------------------------

    4257/2 = > 1/2

    4257/3 = > 1/3

    4257/4 = > 1/4

    ....

    3257/2 = > 1/5

    3257/3 = > 1/6

    3257/4 = > 1/7

    ....

    4457/4 = > 2/2

    4457/5 = > 2/3

    4457/6 = > 2/4

    4457/7 = > 2/5

    ......

    Thanks in advance,

    Thiru

    Hi Poirier,

    I modified your request for entry of csv file.

    Please save it as the xls to text delimetted tab. See the snapshot below.

    Then, run the provided scripts it will change the values.

    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
    
    myFile.open('r');
    while (myFile.eof==false){
         line=myFile.readln();
         line = line.split("\t");
         myFind = line[0];
         myChange = line[1];
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
         app.findGrepPreferences.findWhat = myFind;
         app.changeGrepPreferences.changeTo=myChange;
         app.documents.item(0).changeGrep();
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
         }
    myFile.close();
    

    THX

    csm_phil

  • Is it possible to get the details of the file (for example the subject and comments) off the screen and to an Excel file or a text file without having to retype this information

    Is it possible to get the details of the file (for example the subject and comments) off the screen and to an Excel file or a text file without having to retype this information

    * original title - file details *.

    Hello

    Could you explain what is exactly? What do you mean by off the screen?

    According to my way of thinking, you want to export the file details of all your files on your HARD drive to an excel file or a txt file. If I'm right in this case, it is not possible to export the details of each & every file in the excel sheet.

  • Windows 7 can't copy files on external hard drive and keep showing "cannot read the source file or disk.

    Windows 7 can't copy files on external hard drive and keep showing "cannot read the source file or disk" HELP me PLS
    I'm going crazy because of this

    Hello

    1. What is the format of the file system on the external hard drive?

    2. are you able to copy or move files into the computer?

    You can follow the suggestions mentioned below and check with the question.

     
     
    Method 1:Delete CCG, prefetch files.
     
    Step 1: Delete Temp files

    (1) open the window run (Windows key + R)

    (2) type %temp%, and then press ENTER

    (3) delete all Temp files in the Temp folder
     
    Step 2: Delete Prefetch files

    (1) open the window run (Windows key + R)

    (2) type %temp%, and then press ENTER

    (3) delete all files in the Prefetch folder.

    Method 2: Run the tool (SFC.exe) System File Checker, try to copy the files and check.
     
    Follow the form of measures the following link: http://support.microsoft.com/kb/929833
    Method 3: Run the check disk then try to copy the files and check.
    Note: If bad sectors are found in the hard drive then it could try to fix this particular sector. If you have any data on that, it can get lost.
     
     
    I hope this helps!
  • I have lightroom 6 and just got a nikon d7200, lightroom now reads the tiff file so I can not download my pictures on lightroom

    I have lightroom 6 and just got a nikon d7200, lightroom now reads the tiff file so I can not download my pictures on lightroom

    You really produce TIFF files? If you are, no matter what version of LR read them. Files NAVE, not so much. For NEF files out of this camera, you can either upgrade to the latest 6.4 or CC 2015.4, or you can download the latest free Adobe DNG converter software and use it to convert your files to DNG and import those into LR 5.7.

    Back to TIFF format. If you are trying to import those and get a message that the files cannot be read. You will need to change the permissions on the folder that you copy the image to. Change the permissions if you have read and write access.

  • 5 Lightroom can't read and import the raw file

    I can't import my RAW files from my Nikon D750. When I try to import my SD card, I am able to see the preview, but when I try to import, I get a window that reads "the following files were imported not because they could not be read. I haven't changed anything on my camera on the LR5 parameters settings and this happened just today. I am able to transfer the files on my desk at the moment, but I can't yet import from there. I also tried reformatting the card and even tried another card so I don't think that the problem is the card or the device itself. I also do not seem to see updates that I need. Does anyone have any suggestions?

    As noted of Claes, it is almost certainly a problem with your destination set wrong in the import Panel. This happens quite easily. You get the error message is almost always due to the destination without folder do not write access. Really check your destination. This should NOT be the root of your startup for example disk level and for some reason any sometimes default Lightroom at this place and then refuses to import because the OS refuses to let you write here.

  • I have an annual subscription to Adobe export in PDF, but my computer died and I am setting up a new computer. I also need to download Adobe Reader or Acrobat to download and open the PDF files?

    I export to PDF, but can't seem to download and open the PDF files. I need to download something?

    Hi Lisa,

    To download PDF files, you have nothing else except a web browser.
    However, to open the pdf file that is downloaded, you certainly need to download Acrobat Reader: Adobe - Adobe Acrobat Reader DC Distribution

    Kind regards

    Rahul

  • I bought a new carmera and Photoshop CS4 camera Raw can not read the ARW files.  I downloaded the lateset update but still can not read how can I get this problem solved thanks

    I bought a new carmera and Photoshop CS4 camera Raw can not read the ARW files.  I downloaded the lateset update but still can not read how can I get this problem solved thanks

    Hi tonyf,.

    Greetings!

    Each device is compatible with a minimum version of camera raw.

    Here is the complete list: https://helpx.adobe.com/camera-raw/kb/camera-raw-plug-supported-cameras.html

    Please check if you have this version of the camera installed which include your raw files.

    It would also be that your photoshop will not have to install this version of camera raw as its very old.

    In this case, you can convert your raw files to DNG and can use it.

    To convert the files to DNG, you must download and install the DNG Converter.

    Here is the link:

    Windows: Adobe - Adobe Camera Raw and DNG Converter: for Windows

    MAC: http://www.adobe.com/support/downloads/product.jsp?platform=Macintosh&product=106

    Concerning

    Jitendra

Maybe you are looking for