-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpowerAutomateFlow
107 lines (104 loc) · 5.75 KB
/
powerAutomateFlow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\YourUser\\Desktop\\YourPath\\File.xlsm''' Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''Automate'''
SET Pasta TO $'''C:\\Users\\YourUser\\Desktop\\YourPath'''
Folder.GetFiles Folder: Pasta FileFilter: $'''*pdf''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
**REGION Corridas
LOOP FOREACH pdf IN Files
Pdf.ExtractTextFromPDF.ExtractTextFromPageRange PDFFile: pdf FromPageNumber: 1 ToPageNumber: 1 DetectLayout: False ExtractedText=> textopdf
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''Lote Corrida Placa''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> iniciobloco1
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''Peso Bruto (MT):''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> fimbloco1
SET caracteres TO (fimbloco1 + 25) - iniciobloco1
BLOCK
ON BLOCK ERROR
END
Text.GetSubtext.GetSubtext Text: textopdf CharacterPosition: iniciobloco1 NumberOfChars: caracteres Subtext=> análise
IF caracteres = 0 THEN
NEXT LOOP
END
END
Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: 1 FirstFreeRowOnColumn=> próximalinha
Excel.ActivateCellInExcel.ActivateCell Instance: ExcelInstance Column: 1 Row: próximalinha
Excel.WriteToExcel.Write Instance: ExcelInstance Value: análise
END
**ENDREGION
**REGION Aço
LOOP FOREACH pdf IN Files
Pdf.ExtractTextFromPDF.ExtractTextFromPageRange PDFFile: pdf FromPageNumber: 1 ToPageNumber: 1 DetectLayout: False ExtractedText=> textopdf
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''Especificação''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> iniciobloco1
Text.GetSubtext.GetSubtext Text: textopdf CharacterPosition: iniciobloco1 NumberOfChars: 30 Subtext=> análise
Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: 2 FirstFreeRowOnColumn=> próximalinha
Excel.ActivateCellInExcel.ActivateCell Instance: ExcelInstance Column: 2 Row: próximalinha
Excel.WriteToExcel.Write Instance: ExcelInstance Value: análise
END
**ENDREGION
**REGION Composição Química
LOOP FOREACH pdf IN Files
Pdf.ExtractTextFromPDF.ExtractTextFromPageRange PDFFile: pdf FromPageNumber: 1 ToPageNumber: 1 DetectLayout: False ExtractedText=> textopdf
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''Placa C''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> iniciobloco1
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''----------------------------------------------------------Propriedades''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> fimbloco1
SET caracteres TO fimbloco1 - iniciobloco1
BLOCK
ON BLOCK ERROR
END
Text.GetSubtext.GetSubtext Text: textopdf CharacterPosition: iniciobloco1 NumberOfChars: caracteres Subtext=> análise
IF caracteres = 0 THEN
NEXT LOOP
END
END
Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: 3 FirstFreeRowOnColumn=> próximalinha
Excel.ActivateCellInExcel.ActivateCell Instance: ExcelInstance Column: 3 Row: próximalinha
Excel.WriteToExcel.Write Instance: ExcelInstance Value: análise
END
**ENDREGION
**REGION Ensaio de tração
LOOP FOREACH pdf IN Files
Pdf.ExtractTextFromPDF.ExtractTextFromPageRange PDFFile: pdf FromPageNumber: 1 ToPageNumber: 1 DetectLayout: False ExtractedText=> textopdf
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''Lote Corrida''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> iniciobloco1
Text.ParseText.ParseForFirstOccurrence Text: textopdf TextToFind: $'''-------------------------------------------------------------------------- Produto''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> fimbloco1
SET caracteres TO fimbloco1 - iniciobloco1
BLOCK
ON BLOCK ERROR
END
Text.GetSubtext.GetSubtext Text: textopdf CharacterPosition: iniciobloco1 NumberOfChars: caracteres Subtext=> análise
IF caracteres = 0 THEN
NEXT LOOP
END
END
Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: 4 FirstFreeRowOnColumn=> próximalinha
Excel.ActivateCellInExcel.ActivateCell Instance: ExcelInstance Column: 4 Row: próximalinha
Excel.WriteToExcel.Write Instance: ExcelInstance Value: análise
END
**ENDREGION
**REGION Tratamento Dos Dados
BLOCK
ON BLOCK ERROR
REPEAT ACTION
END
Excel.RunMacro Instance: ExcelInstance Macro: $'''propriedade_mec'''
SET prop_mec TO $'''Excel.RunMacro Instance: ExcelInstance Macro: $\'\'\'propriedade_mec\'\'\''''
END
WAIT (System.WaitForProcess.ProcessToStop ProcessName: prop_mec)
BLOCK
ON BLOCK ERROR
REPEAT ACTION
END
Excel.RunMacro Instance: ExcelInstance Macro: $'''tratar_embarcados'''
SET tratar_embarcados TO $'''Excel.RunMacro Instance: ExcelInstance Macro: $\'\'\'tratar_embarcados\'\'\''''
END
WAIT (System.WaitForProcess.ProcessToStop ProcessName: tratar_embarcados)
BLOCK
ON BLOCK ERROR
REPEAT ACTION
END
Excel.RunMacro Instance: ExcelInstance Macro: $'''comp_quim'''
SET composição_quimica TO $'''Excel.RunMacro Instance: ExcelInstance Macro: $\'\'comp_quim\'\''''
END
WAIT (System.WaitForProcess.ProcessToStop ProcessName: composição_quimica)
BLOCK
ON BLOCK ERROR
REPEAT ACTION
END
Excel.RunMacro Instance: ExcelInstance Macro: $'''Dados_T'''
SET Dados_Tratados TO $'''Excel.RunMacro Instance: ExcelInstance Macro: $\'\'\'dados_tratados\'\'\''''
END
**ENDREGION